package com.basic.common.exception.business;


import com.basic.common.exception.Errors;
import com.basic.common.result.WebResult;

/**
 * 第三方系统异常
 * @author
 * @since
 */
public class ExternalSystemException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private String type;
    private String code;
    private String exception;
    private String msg;
    private Byte systemId;

    public ExternalSystemException() {
        super();
    }

    public ExternalSystemException(Throwable cause) {
        super(cause);
    }

    public ExternalSystemException(String type, String code) {
        this.type = type;
        this.code = code;
    }

    public ExternalSystemException(String code, String exception, String msg) {
        super(msg);
        this.code = code;
        this.exception = exception;
        this.msg = msg;
    }

    public ExternalSystemException(Errors errors) {
        super(errors.msg);
        this.code = errors.code;
        this.exception = errors.exception;
        this.msg = errors.msg;
    }

    public ExternalSystemException(WebResult webResult) {
        super(webResult.getMsg());
        this.code = webResult.getCode();
        this.exception = webResult.getException();
        this.msg = webResult.getMsg();
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getException() {
        return exception;
    }

    public void setException(String exception) {
        this.exception = exception;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Byte getSystemId() {
        return systemId;
    }

    public void setSystemId(Byte systemId) {
        this.systemId = systemId;
    }
}